# -*- coding: utf-8 -*-
"""
 @Time    : 2021/2/6 下午5:03
 @Author  : tgy
 
"""
import socket
import time

class Server:
    ...

    def __init__(self, address):
        ...
        self.socket = socket.socket(family=socket.AF_INET, type=socket.SOCK_STREAM)
        self.socket.bind(address)
        # 三次握手的缓存大小，最多5个，也就是最多允许5个连接同时处在三次握手成功，如果还有其他链接进来，直接拒绝链接
        self.socket.listen(5)

    def start(self):
        ...
        while True:
            connect, client_address = self.socket.accept()
            print(client_address)
            time.sleep(1000000)
            # connect.send(b'server')
            # connect.close()


if __name__ == '__main__':
    ...
    server = Server(address=('0.0.0.0', 8083))
    server.start()